package systemmaintenance.action;

import systemmaintenance.dao.MaintenanceDao;
import systemmaintenance.model.Maintenance;

import com.opensymphony.xwork2.ActionSupport;
import companysynopsis.model.Synopsis;

public class MaintenanceAction extends ActionSupport{
	private static final long serialVersionUID = 1L;
	private MaintenanceDao maintenanceDao;
	private Maintenance maintenance;
	public MaintenanceDao getMaintenanceDao() {
		return maintenanceDao;
	}
	public void setMaintenanceDao(MaintenanceDao maintenanceDao) {
		this.maintenanceDao = maintenanceDao;
	}
	public Maintenance getMaintenance() {
		return maintenance;
	}
	public void setMaintenance(Maintenance maintenance) {
		this.maintenance = maintenance;
	}
	public String toMaintenance(){
		
		Maintenance maintenance2 = new Maintenance();
		maintenance2.setMaintenance("maintenance");
		maintenanceDao.saveOrUpdate(maintenance2);
		maintenance = maintenanceDao.findById(1L);
		return SUCCESS;
	}
	public String toMaintenanceAdmin(){
		System.out.println("111111111111111111");
		maintenance = maintenanceDao.findById(1L);
		return SUCCESS;
	}
	public String saveMaintenance(){
		System.out.println("222222222222");
		System.out.println(maintenance.getId());
		maintenanceDao.update(maintenance);
		return SUCCESS;
	}
	
	
	

}
